import fetch from 'utils/fetch';
/**
 * 账户管理
 */
//保存账户详情
export function saveOrgAccount(fOrgType, sBussinessLicene, sOpenAccount, sCardFace, sCardBack, sName, sAccountName, fCardNum, fAccountId, fBankId, fBankProvince, fBankCity, sOpenName, fTelphoneNum) {
    const data = {
        fOrgType,
        sBussinessLicene,
        sOpenAccount,
        sCardFace,
        sCardBack,
        sName,
        sAccountName,
        fCardNum,
        fAccountId,
        fBankId,
        fBankProvince,
        fBankCity,
        sOpenName,
        fTelphoneNum
    };
    return fetch({
        url: 'OrgAccount/saveOrgAccount',
        method: 'post',
        data,
    });
}

//获取安全规则
export function getRule() {
    const params = {};
    return fetch({
        url: 'captcha/getRule',
        method: 'get',
        params, 
    })
}

//获取验证码
export function register(sUserPhone, verification, timeStamp) {
    const data = {
        sUserPhone,
        verification,
        timeStamp
    };
    return fetch({
        url: 'captcha/register',
        method: 'post',
        data,
    });
}
//校验验证码
export function captchcode(sCaptcha, sUserPhone) {
    const data = {
        sCaptcha,
        sUserPhone
    };
    return fetch({
        url: 'captcha/captchcode',
        method: 'post',
        data,
    });
}
//获取银行列表
export function listBankCards() {
    const params = {

    };
    return fetch({
        url: 'Bank/listBankCards',
        method: 'get',
        params,
    });
}
//查询详情
export function getOrgAccountDetail() {
    return fetch({
        url: 'OrgAccount/getOrgAccountDetail',
        method: 'post'
    });
}
//分页查询
export function pageSettleRecord(page, rows, startTime, endTime) {
    const data = {
        page,
        rows,
        startTime,
        endTime
    };
    return fetch({
        url: 'settle/pageSettleRecord',
        method: 'post',
        data,
    });
}
//查询经销商银行卡信息
export function getAgentBank(sUserPhone) {
    const data = {
        sUserPhone
    };
    return fetch({
        url: 'settle/getAgentBank',
        method: 'post',
        data,
    });
}

//查询查询经销商增值账户信息
export function getIncrementAccount(sUserPhone) {
    const data = {
        sUserPhone
    };
    return fetch({
        url: 'settle/getIncrementAccount',
        method: 'post',
        data,
    });
}

//结算
export function saveSettleRecord(money, bankId, intervalStartTime, intervalEndTime) {
    const data = {
        money,
        bankId,
        intervalStartTime,
        intervalEndTime
    };
    return fetch({
        url: 'settle/saveSettleRecord',
        method: 'post',
        data,
    });
}

//经销商区间结算金额
export function getIntervalSettlementAmount(intervalStartTime, intervalEndTime) {
    const data = {
        intervalStartTime,
        intervalEndTime
    };
    return fetch({
        url: 'settle/getIntervalSettlementAmount',
        method: 'post',
        data,
    });
}

//经销商结算区间查询
export function getAgentLatestSettlement() {
    return fetch({
        url: 'settle/getAgentLatestSettlement',
        method: 'post',
    });
}

//当前结算信息
export function getSettlementAgentData(pId) {
    const data = {
        pId
    };
    return fetch({
        url: 'settle/getSettlementAgentData',
        method: 'post',
        data,
    });
}

//结算区间明细接口
export function listPayIncrementDetailInfo(page, rows, intervalStartTime, intervalEndTime) {
    const data = {
        page,
        rows,
        intervalStartTime,
        intervalEndTime
    };
    return fetch({
        url: 'settle/listPayIncrementDetailInfo',
        method: 'post',
        data,
    });
}
//分页查询会员订单
export function listMembershipPayDetailInfo(page, rows, intervalStartTime, intervalEndTime) {
    const data = {
        page,
        rows,
        intervalStartTime,
        intervalEndTime
    };
    return fetch({
        url: 'settle/listMembershipPayDetailInfo',
        method: 'post',
        data,
    });
}
// 分页查询打包订单
export function pageMembershipPackPayDetailInfo(page,rows,startDate,endDate) {
    const data = {
        page,
        rows,
        startDate,
        endDate
    };
    return fetch({
        url: '/settle/pageMembershipPackPayDetailInfo',
        method: 'post',
        data
    });
}

